package com.dream.wukong.common.core.jdbc;

import com.alibaba.druid.pool.DruidDataSource;
import com.dream.wukong.common.core.util.DesUtil;

/**
 * @Author: wuyichao
 * @Description:
 * @Date: Created in 17:27 2018/9/17.
 * @Modified:
 */
public class DecryptDruidSource extends DruidDataSource {

    private static final String DES_KEY = "www.wukong.com";

    @Override
    public void setUsername(String username) {
        try {
            username = DesUtil.decrypt(username,DES_KEY);

        } catch (Exception e) {
            e.printStackTrace();
        }
        super.setUsername(username);
    }

    @Override
    public void setPassword(String password){
        try {
            password = DesUtil.decrypt(password,DES_KEY);

        } catch (Exception e) {
            e.printStackTrace();
        }
        super.setPassword(password);
    }

}
